Conversation
| function a () { | ||
| var contact = prompt("Add the contact."); | ||
| } |
There was a problem hiding this comment.
Is this code just for debugging?
There was a problem hiding this comment.
Yes. I have removed it
There was a problem hiding this comment.
Whoops. Sorry. I didn't mean to include that in my review. I saw you had already deleted it. I forgot to go back and delete the comment.
mheppler
left a comment
There was a problem hiding this comment.
Added comments regarding suggested optimization as well as a question about potential broken functionality on pgs that aren't the dataverse pg.
| <h:outputLink value="/dataset.xhtml?ownerId=#{dataverseServiceBean.findRootDataverse().id}"> | ||
| <h:outputText value="#{bundle['dataverse.results.btn.addData.newDataset']}"/> | ||
| </h:outputLink> | ||
| <ui:fragment rendered="#{showAddDataGroup}"> |
There was a problem hiding this comment.
The render logic in these duplicate ui:fragment components should consolidated and moved directly into the li components like other navbar features on this page <li jsf:rendered="#{...}"> (line 88).
There was a problem hiding this comment.
as requested I removed the ui:fragments and moved the render logic to jsf:rendered.
| <li class="dropdown"> | ||
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">#{bundle['dataverse.results.btn.addData']} <b class="caret"></b></a> | ||
| <ul class="dropdown-menu"> | ||
| <ui:fragment rendered="#{showAddDataverseLink}"> |
There was a problem hiding this comment.
Same render logic moved into the li here as suggested above.
| <ui:fragment rendered="#{showAddDataGroup}"> | ||
| <ui:fragment rendered="#{!authUserSession}"> | ||
| <li> | ||
| <a href="#" onClick="PF('addData_popup').show()">#{bundle['dataverse.results.btn.addData']} </a> |
There was a problem hiding this comment.
This addData_popup reference that was copied over from search-include-fragment will now look for that dialog on every page, but the dataverse pg is the only page that will have the dialog included on it.
There was a problem hiding this comment.
I made the add data popup into a fragment and included it in the dataverse template.
| </f:facet> | ||
| </p:ajaxStatus> | ||
| <ui:include src="contactFormFragment.xhtml"></ui:include> | ||
| <ui:include src="addDataFormFragment.xhtml"></ui:include> |
There was a problem hiding this comment.
I was wondering what the best way to handle this popup is, and I think this a great solution. 👍
-if the user is not logged in when pressing button
What this PR does / why we need it:
This modifies the rendering of the Add Data buttonsin the header The Add Data button in the header has been changed so that whether or not the user is not logged in it will be rendered based on the permissions of a generic authenticated user in the Root Dataverse.
Functionality of the Add Data button in the body of the Dataverse Page is unchanged (and based on the respective permissions of the Dataverse being viewed.)
Which issue(s) this PR closes:
Closes #6741
Special notes for your reviewer:
I am making use of ui:params to isolate the render logic
Suggestions on how to test this:
Does this PR introduce a user interface change?:
no
Is there a release notes update needed for this change?:
no
Additional documentation:
none